﻿var app = require('express')();
var http = require('http').Server(app);
var io = require('socket.io')(http);
var signCode = "slel3@lsl334xx,deka";
var log = require("./../util/loginfo").getInstand;
var gameConfig = require('./config/gameConfig');
var robotInfo = require('./class/robot').getInstand;
robotInfo.init();


io.on('connection', function (socket) {

    socket.emit('connected', 'connect game server');

});


app.set('port', process.env.PORT || gameConfig.port);

var server = http.listen(app.get('port'), function () {
    log.info('start at port:' + server.address().port);
});


function jsonp(code) {
    try {
        var data = JSON.parse(code);
        return data;
    } catch (e) {
        log.warn(code);
        log.warn('解析json,出错!');
    }
}

log.info("机器人服务器启动");



